<?php
declare (strict_types = 1);

namespace app\admin\validate;

use think\Validate;

class Coupon extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'money' => 'require',
        'out_money' => 'require',
        'count' => 'require',
        'day' => 'require',
        'integral' => 'require',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [
        'money.require' => '请输入优惠券满减金额',
        'out_money.require' => '请输入优惠券启用金额',
        'count.require' => '请输入优惠券数量',
        'day.require' => '请输入优惠券有效时间',
        'integral.require' => '请输入兑换优惠券所需积分'
    ];

    protected $scene = [
        'add'  =>  ['money','out_money','count','day','integral'],
        'edit'  =>  ['money','out_money','count','day','integral'],
    ];
}
